package com.autumn.zero.workflow.application.dto.forms;

import java.util.ArrayList;
import java.util.List;

import com.autumn.util.ExceptionUtils;

/**
 * 
 * 工作流表单输入
 * 
 * @author 杨昌国 2018-12-20 10:17:14
 */
public class WorkflowFormInput extends WorkflowFormDto {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4462275884454540144L;

	private List<WorkflowFormPropertyInput> propertys = new ArrayList<>();

	public List<WorkflowFormPropertyInput> getPropertys() {
		return propertys;
	}

	public void setPropertys(List<WorkflowFormPropertyInput> propertys) {
		this.propertys = propertys;
	}

	@Override
	public void valid() {
		super.valid();
		List<WorkflowFormPropertyInput> items = this.getPropertys();
		if (items != null) {
			for (WorkflowFormPropertyInput item : items) {
				if (item == null) {
					ExceptionUtils.throwValidationException("存在 null 的项目。");
				}
				item.valid();
			}
		}
	}
}
